package org.fhawk.microservice.produce.controller;

import org.fhawk.microservice.service.ServiceApi;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProduceController implements ServiceApi {

    @Value("${spring.cloud.config.profile}")
    private String profile;
    @Value("${spring.cloud.config.uri}")
    private String uri;
    @Value("${spring.cloud.config.label}")
    private String label;
    @Value("${eureka.client.serviceUrl.defaultZone}")
    private String eureka;
    @Value("${spring.zipkin.base-url}")
    private String zipkin;

    @Override
    @PreAuthorize("hasAuthority('query-demo')")
    public String hello(String name) {

        return name + "    profile:" + profile + " uri:" + uri + " label:" + label + " eureka:" + eureka + " zipkin:" + zipkin;
    }
}
